import Layout from './views/Layout'
import { lazy } from 'react'
import { createHashRouter } from 'react-router'
// import Home from './views/Home'
import Manage from './views/Manage'
import Promotion from './views/Promotion'
import Analysis from './views/Analysis'
import App from './App'
import Coupon from './views/Coupon'
import MemberInfo from '@/views/MemberInfo'
import path from 'path'

const MemberCare = lazy(() => import('@/views/MemberCare'))
const Home = import('./views/Home')
// const Manage = import('./views/Manage')
// const Promotion = import('./views/Promotion')
// const Analysis = import('./views/Analysis')

const routes = [
    {
        path: "/",
        Component: App,
        children: [
            {
                path: "/",
                element: <Layout />,
                children: [
                    {
                        path: "/home",
                        Component: lazy(() => Home)
                    },
                    {
                        path: "/manage",
                        Component: Manage
                    },
                    {
                        path: '/promotion',
                        Component: Promotion
                    },
                    {
                        path: '/analysis',
                        Component: Analysis
                    }
                ]
            },
            {
                path: "/member",
                Component: lazy(() => import('@/views/MemberPage'))
            },
            {
                path: "/care",
                element: <MemberCare />
            },
            {
                path: "/coupon",
                Component: Coupon
            },
            {
                path: "/info",
                Component: MemberInfo
            },
            {
                path: "/filter",
                Component: lazy(() => import('@/views/Filter'))
            },
            {
                path: "/gift",
                Component: lazy(() => import('@/views/Gift'))
            },
            {
                path: "*",
                element: <div>404</div>
            }
        ]
    }
]

export default createHashRouter(routes)